package com.logis.ryanrqwork.daoutil;

import android.content.Context;

import com.logis.ryanrqwork.DBController;
import com.logis.ryanrqwork.dao.User;
import com.logis.ryanrqwork.dao.UserDao;

import java.util.List;

public class UserDaoController {
    public static boolean registerUser(Context context,String userName,String password){
        User user=new User(null,userName,password,"","","",0);
        DBController.getInstance(context).getDaoSession().getUserDao().insertOrReplace(user);
        return true;
    }
    public static User getUserInfo(Context context,String userName,String password){
        return DBController.getInstance(context).getDaoSession().getUserDao().queryBuilder().where(UserDao.Properties.UserName.eq(userName),UserDao.Properties.UserPassword.eq(password)).unique();
    }
}
